home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
asmbler.arc
/
CURSOR.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-11-19
|
2KB
|
70 lines
title cursor
COMMENT \
Set the cursor to a blinking block or blinking underline. Regrettably,
the blink frequency is not variable, only the vertical size, and the
cursor is stored by BIOS only in an output-only port making it
impossible for this routine to toggle the current cursor.
Usage: CURSOR [/B] [/U]
A block cursor is selected by the switch /B or if no switches are
specified, and an underline cursor by the switch /U. Only the
first valid switch found is used in the event that more than one
is specified.
[24-Jan-84] Nelson H.F. Beebe, University of Utah
\
assume cs:cursor, ds:cursor, es:cursor, ss:cursor
include ascii.inc
include dos.inc
cursor segment para public 'code'
org 100h ; this will be a .COM file
start:
mov si,81h ; Beginning of parameter line in PSP
xor ch,ch ; Clear top half of cx
mov cl,[si-1] ; Length of parameter line in cx from 80h
jcxz setb ; Skip scan if line empty
mov ah,$DOS_SWITCH
mov al,$DOS_SWITCH_GET
int $DOS ; Get switch character in dx
scan: ; scan command line for switches
lodsb ; byte from [si] to al, increment si
cmp al,dl ; switch character?
jne test ; no, keep scanning
cmp cx,1 ; more characters?
jbe setb ; no
lodsb ; get switch letter
cmp al,'a' ; convert to upper case
jb comp
cmp al,'z'
ja comp
and al,NOT 20h ; turn off lower-case bit
comp:
cmp al,'B' ; /B?
je setb
cmp al,'U' ; /U?
je setu
test:
loop scan ; loop while cx > 0
setb:
mov cx,000Ch ; Block cursor in lines 00 .. 0C
jmp short set
setu:
mov cx,0B0Dh ; Underline cursor in lines 0B .. 0D
jmp short set
set:
mov ah,$VIDEO_SETCURSORTYPE
int $VIDEO ; Set the cursor
mov al,0 ; return code
mov ah,$DOS_EXIT
int $DOS ; Exit to DOS
cursor ends
end start